package com.game.mini.common;

public class GamePlay {
	public final static int PIECE_W_S						= 14; //for data, in pixels
	public final static int PIECE_H_S						= 14; //for data, in pixels
	
	public final static int PIECE_W_M						= 20; //for data, in pixels
	public final static int PIECE_H_M						= 20; //for data, in pexels
	
	public final static int BOARD_ROW						= 20; //for logic
	public final static int BOARD_COL						= 12; //for logic
	
	public final static int PIECE_ROW						= 5; //for logic
	public final static int PIECE_COL						= 5; //for logic
	public final static int PIECE_NUM_TYPES					= 7;
	public final static int PIECE_NUM_ROTATION				= 4;
	public final static int PIECE_SQUARE_IDX				= 0; //first index in PIECE_COLLECTION array
	public final static int PIECE_LONG_IDX					= PIECE_SQUARE_IDX + 1;
	public final static int PIECE_L_IDX						= PIECE_LONG_IDX + 1;
	public final static int PIECE_LMIRROR_IDX				= PIECE_L_IDX + 1;
	public final static int PIECE_N_IDX						= PIECE_LMIRROR_IDX + 1;
	public final static int PIECE_NMIRROR_IDX				= PIECE_N_IDX + 1;
	public final static int PIECE_T_IDX						= PIECE_NMIRROR_IDX + 1;
	
	public final static char[][][][] PIECE_COLLECTION = {
		{ // square
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 2, 1, 0},
				{0, 0, 1, 1, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 2, 1, 0},
				{0, 0, 1, 1, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 2, 1, 0},
				{0, 0, 1, 1, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 2, 1, 0},
				{0, 0, 1, 1, 0},
				{0, 0, 0, 0, 0},
			}
		},
		{ // Long
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 1, 2, 1, 1},
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 2, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 1, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{1, 1, 2, 1, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 1, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 2, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 0, 0, 0},
			}
		},
		{ // L
			{
				{0, 0, 0, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 2, 0, 0},
				{0, 0, 1, 1, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 1, 2, 1, 0},
				{0, 1, 0, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 1, 1, 0, 0},
				{0, 0, 2, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 1, 0},
				{0, 1, 2, 1, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
			}
		},
		{ // L-mirror
			{
				{0, 0, 0, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 2, 0, 0},
				{0, 1, 1, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 1, 0, 0, 0},
				{0, 1, 2, 1, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
			}, 
			{
				{0, 0, 0, 0, 0},
				{0, 0, 1, 1, 0},
				{0, 0, 2, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 1, 2, 1, 0},
				{0, 0, 0, 1, 0},
				{0, 0, 0, 0, 0},
			}
		},
		{ // N
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 1, 0},
				{0, 0, 2, 1, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 1, 2, 0, 0},
				{0, 0, 1, 1, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 1, 2, 0, 0},
				{0, 1, 0, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 1, 1, 0, 0},
				{0, 0, 2, 1, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
			}
		},
		{ // N-mirror
			{
				{0, 0, 0, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 2, 1, 0},
				{0, 0, 0, 1, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 2, 1, 0},
				{0, 1, 1, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 1, 0, 0, 0},
				{0, 1, 2, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 1, 1, 0},
				{0, 1, 2, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
			}
		},
		{ // T
			{
				{0, 0, 0, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 2, 1, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
				{0, 1, 2, 1, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 0, 0, 0},
			},
			{
				{0, 0, 0, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 1, 2, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 0, 0, 0, 0},
			}, 
			{
				{0, 0, 0, 0, 0},
				{0, 0, 1, 0, 0},
				{0, 1, 2, 1, 0},
				{0, 0, 0, 0, 0},
				{0, 0, 0, 0, 0},
			}
		}
	};
}
